// Function adds the selected member to the roster list.
function add_member() {
	var rosterList = document.getElementById('roster');
	var memberList = document.getElementById('members');
	
	// Check if something is selected.
	if (memberList.selectedIndex != -1) {
		// Add the selected option to the roster list.
		rosterList.add(memberList.options[memberList.selectedIndex], null);
	}
}

// Function to remove members from the roster list.
function rem_member() {
	var rosterList = document.getElementById('roster');
	var memberList = document.getElementById('members');
	
	// Check if something is selected.
	if (rosterList.selectedIndex != -1) {
		// Add the selected option to the roster list.
		memberList.add(rosterList.options[rosterList.selectedIndex], null);
	}
}

// Function to add all the members to the roster.
function add_all_members() {
	var rosterList = document.getElementById('roster');
	var memberList = document.getElementById('members');
	
	var members = memberList.options.length;
	
	while (members > 0) {
		rosterList.add(memberList.options[members - 1], null);
		members = memberList.options.length;
	}
}

// Function to remove all the members to the roster.
function rem_all_members() {
	var rosterList = document.getElementById('roster');
	var memberList = document.getElementById('members');
	
	var members = rosterList.options.length;
	
	while (members > 0) {
		memberList.add(rosterList.options[members - 1], null);
		members = rosterList.options.length;
	}
}

// Function to select all the options in the roster menu to submit
function rosterSelectAll() {
	var rosterList = document.getElementById('roster');

	for (var i = 0; i < rosterList.options.length; i++) {
		rosterList.options[i].selected = true;
	}
}